import Vue from 'vue'
import App from './App.vue'
import { router } from './router'
import 'amfe-flexible'
import axios from 'axios'

// 判断是否为mock模式
if (process.env.NODE_ENV !== 'production') {
  require('../mock/mockServer.js')
}

Vue.config.productionTip = false

Vue.prototype.axios=axios
axios.defaults.baseURL = '/api'
axios.defaults.headers.post['Content-Type'] = 'application/json'

//设置header，添加token
// axios.interceptors.request.use(
//   config => {
//     if (localStorage.getItem('token')) {
//       config.headers.Authorization = localStorage.getItem('token');
//     }
//
//     return config;
//   },
//   error => {
//     return Promise.reject(error);
//   });


new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
